package pers.adogs.novelboot.manager.message;

import jakarta.mail.internet.InternetAddress;
import jakarta.mail.internet.MimeMessage;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.stereotype.Component;
import pers.adogs.novelboot.core.config.MailProperties;
import pers.adogs.novelboot.core.constant.MessageSenderTypeConsts;

/**
 * @author adogs
 */
@Component(value = MessageSenderTypeConsts.VERIFY_CODE_MAIL_SENDER)
@EnableConfigurationProperties(MailProperties.class)
@Slf4j
public class VerifyCodeMailSender extends AbstractMailSender{


    public VerifyCodeMailSender(MailProperties mailProperties, JavaMailSender mailSender) {
        super(mailProperties, mailSender);
    }

    @Override
    protected String getTitleTemplate() {
        return "欢迎来到小说屋，您正在注册账户";
    }

    @Override
    protected String getContentTemplate() {
        return """
                <div>
                    感谢你注册小说屋！
                </div>
                <ul>
                    <li> 您的验证码为：{}
                </ul>
                <div style="padding: 10px 0 50px 0; text-align: center;">
                    <p> 请勿将验证码转发给其他人，验证码将在5分钟内有效。</p>
                </div>
            """;
    }

}
